﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PotatoSoft.VOCTS.Workbench;

namespace PotatoSoft.Middleware
{
    public class VisualOctStudioData
    {
        private PotatoSoft.VOCTS.Workbench.Workbench workbench;
        private Workspace actualWorkspace;

        public VisualOctStudioData()
        {
            workbench = new PotatoSoft.VOCTS.Workbench.Workbench();
        }

        public WorkspaceMetadata WorkspaceData
        {
            get
            {
                return workbench.GetMetadata(0);
            }
        }

        public ImagePotato GetImage(int projectId, int examinationId, int imageId)
        {
            WorkbenchImage workbenchImage = workbench.GetImageByMetadata(imageId);
            //WorkbenchImage workbenchImage = workbench.GetImageByMetadata(actualWorkspace.WorkspaceID, projectId, examinationId, imageId);
            ImagePotato_8u ip8u = new ImagePotato_8u(workbenchImage.ImageWidth, workbenchImage.ImageHeight, workbenchImage.ImageData);
            ip8u.Name = workbenchImage.ImageName;
            return ip8u;
        }
    }
}
